package com.tchy.cloud.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created by xiaoji on 2017/2/20.
 */
public class AOfficialColumnsEntityPK implements Serializable {
    private Integer columnsId;
    private Long articleId;

    @Column(name = "columns_id")
    @Id
    public Integer getColumnsId() {
        return columnsId;
    }

    public void setColumnsId(Integer columnsId) {
        this.columnsId = columnsId;
    }

    @Column(name = "article_id")
    @Id
    public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AOfficialColumnsEntityPK that = (AOfficialColumnsEntityPK) o;

        if (columnsId != that.columnsId) return false;
        if (articleId != that.articleId) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = columnsId;
        result = 31 * result + (int) (articleId ^ (articleId >>> 32));
        return result;
    }
}
